package com.yhally.eureka;

import com.yhally.eureka.common.CommonResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.concurrent.TimeUnit;

@RestController
@RequestMapping("/echo")
public class EchoController {

    @GetMapping("/sayHello")
    public CommonResult sayHello() {
//        try {
//            // 模拟超时异常
//            TimeUnit.SECONDS.sleep(20);
//        } catch (InterruptedException e) {
//            e.printStackTrace();
//        }
        return new CommonResult(200, "Hello!");
    }
}
